package com.xtpt.disaster.common.consts;

/**
 * @author jack_xin
 * @ClassName BackupType
 * @Desc 数据库备份类型，全量0，增量1
 * @date 2021年11月18日 20:01
 * @Version TODO
 */
public enum BackupTypeEnum implements BaseEnum{
    FULL("全量备份", 0),
    INCREMENT("增量备份", 1);

    private String desc;
    private Integer value;

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    BackupTypeEnum(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }

    /**
     * @Author jack xin
     * @Method Name getObject
     * @Desc 根据value返回枚举类对象DbBackupTypeEnum
     * @Param [value]
     * @return com.xtpt.disaster.common.consts.BackupTypeEnum
     * @Date 20:09 2021/11/18
    **/
    public static BackupTypeEnum getObject(Integer value){
        for(BackupTypeEnum backupTypeEnum : BackupTypeEnum.values()) {
            if(backupTypeEnum.getValue().equals(value)){
                return backupTypeEnum;
            }
        }
        return null;
    }

    @Override
    public java.lang.Integer getValue() {
        return value;
    }
}
